<?php
if (empty($_SESSION['is_admin'])) {
	_404();
	die();
}

include("controllers/base.php");

class Controller_Index extends Controller_Base {
    function index() {
		$this->_view->setTemplate('templates' . DIRSEP . 'admin' . DIRSEP . 'index.tpl');
        $this->_view->render();
	}
	
    function skills($id = null) {
		if ($id){
			$this->_view->setTemplate('templates' . DIRSEP . 'admin' . DIRSEP . 'skill.tpl');
			$this->_view->setParams(array('skills' => $this->registry['db']->getSkills($id)));
		}
		else{
			$this->_view->setTemplate('templates' . DIRSEP . 'admin' . DIRSEP . 'skills.tpl');
			$this->_view->setParams(array('skills' => $this->registry['db']->getSkills()));
		}
			
        $this->_view->render();
	}
}
?>